package com.hhkj.admin.sale.model.dopo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.hhkj.admin.sale.common.cont.SaleConst;
import com.hhkj.admin.sale.domain.Sale;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class SaleManagementPo extends Sale {

    /** 所属销售名字 **/
    private String rootName;

    /** 所属销售编号 **/
    private String rootNum;

    /** 商家名称和编号 **/
    @Excel(name = "商家名称", orderNum = "0", width = 25)
    private String sale;

    /** 成交单数 **/
    @Excel(name = "成交单数", orderNum = "3", width = 25, type = 10, numFormat = "0")
    private Integer dealAmount = 0;

    /** 累计消费 **/
    @Excel(name = "累计消费", orderNum = "4", width = 25, type = 10, numFormat = "#,##0.00")
    private BigDecimal dealPrice;

    /** 累计佣金 **/
    @Excel(name = "累计佣金", orderNum = "5", width = 25, type = 10, numFormat = "#,##0.00")
    private BigDecimal commissionPrice;

    /** 累计提现 **/
    @Excel(name = "累计提现", orderNum = "6", width = 25, type = 10, numFormat = "#,##0.00")
    private BigDecimal withdrawalPrice;

    /** 所属销售 **/
    @Excel(name = "所属销售", orderNum = "7", width = 25)
    private String saleRoot;

    /** 禁用状态 **/
    @Excel(name = "禁用状态", orderNum = "8", width = 25)
    private String disabledStatus;

    public String getSale() {
        return getName() + "(" + getNum() + ")";
    }

    public String getSaleRoot() {
        return getRootName() + "(" + getRootNum() + ")";
    }

    public String getDisabledStatus() {
        return SaleConst.DisabledFlag.getNameByCode(getDisabledFlag());
    }
}
